home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / utility / bfind608.zip / BFIND.DOC next >
Text File  |  1996-07-19  |  14KB  |  326 lines

  1. BFIND.DOC                            1                         Revised: 07-19-96
  2.  
  3. The BFIND.EXE program adds Boolean logic to DOS's FIND command.  In  most  ways,
  4. it's identical to the FIND command except:
  5.  
  6.   * Adds AND, OR, NOT, and XOR options to searches (finding all lines with
  7.     "Apples" or "Bananas", for example).
  8.   * Allows you to specify the starting column of the desired string.
  9.   * Adds a pause (/P) option to have the output pause every 24 lines.
  10.   * Avoids need to include the search string in quotation marks so you can
  11.     use the program more easily in batch commands.
  12.   * The input file specification can include standard DOS wildcards or an
  13.     external file (@listfile) containing the files to be processed, e.g:
  14.         BFIND /I "SOUND" *.DOC > TEMP.X
  15.   * Allows you to skip the by-file heading information ("----- filename").
  16.   * Can avoid showing file name header if no hits in the file (/-EMPTY option).
  17.   * Handles DOS text files (lines end with CR/LF), Mac text files (lines end
  18.     with CR), or Unix text files (lines end with LF).
  19.   * Should be able to handle input files with line lengths of 5000 characters
  20.     or more.
  21.   * Allows you to remove non-text characters from the output or even specify
  22.     your own character-translation file for them.
  23.  
  24. The only FIND feature that BFIND does *not* support is the  ability  to  specify
  25. multilple single input  files  without  using  wildcards  ("FIND  ...  BRUCE.TXT
  26. BRUCE.DOC" works--"BFIND ... BRUCE.TXT BRUCE.DOC" does not).  In  addition,  you
  27. cannot do piping into BFIND (e.g. DIR | BFIND ...).
  28.  
  29. The DOS FIND command allows you to find lines in a text  file  which  contain  a
  30. given string.  You can also have the program tell you how  many  lines  met  the
  31. search criteria without actually viewing them which is an ideal way to find  out
  32. how many times a given string appears in your file.  You can even  use  FIND  to
  33. tell you how many total lines are in a given file just by  requesting  a  string
  34. that you know will never appear in your file  like  "#X$S$"  and  using  the  /C
  35. (count) parameter.
  36.  
  37. BFIND adds to these capabilities.  It gives you the power of AND, OR,  NOT,  and
  38. XOR, allowing you to find any line, for example, that contains both "Apples" and
  39. "Oranges" or to present any lines that contain either "Bananas" and "Pears".  In
  40. addition, you can do column-specific searching, finding only those  lines,  say,
  41. that contain "PRINT" beginning in column 10.
  42.  
  43. BFIND allows you to specify wildcards for the input file.  You can also put  the
  44. list of file names to process in a text file and tell BFIND to process the files
  45. listed therein.
  46.  
  47.  
  48. Specifying parameters:
  49.  
  50. Parameters for this program can be set in the following ways.  The last  setting
  51. encountered always wins:
  52.   - Read from an *.INI file (see BRUCEINI.DOC file),
  53.   - Through the use of an environmental variable (SET BFIND=whatever), or
  54.   - From the command line (see "Syntax" below)
  55.  
  56.  
  57.  
  58. BFIND.DOC                            2                         Revised: 07-19-96
  59.  
  60. Syntax:
  61.  
  62.     BFIND [ /V | /-V ] [ /C | /-C ] [ /N | /-N ] [ /I | /-I ] [ /P | /-P ]
  63.       [ /-HEADER ] [ /-EMPTY ] [ /FILTER | /FILTER=filename ]
  64.       [ /LINES { line1-line2 | line1 linect } ... ]
  65.       [ /MONO ] [ /Iinitfile | /INULL ] [ /? ] [ /?&H ]
  66.       { search } { filespec | @listfile } [ >filename ]
  67.  
  68. where:
  69.  
  70. "/V" says to find those items that do NOT match  the  specification.   Initially
  71. defaults to "/-V".
  72.  
  73. "/-V" says to find those  items  that  DO  match  the  specification.   This  is
  74. initially the default.
  75.  
  76. "/C" says to show the count of the items found (no individual lines).  Initially
  77. defaults to "/-C".  One use for the "/C" parameter is to  count  the  number  of
  78. lines in a file; search for all lines that  do  *not*  (/V)  contain  a  totally
  79. improbable string and then tally them.  E.g.
  80.  
  81.         BFIND /V /C "&^&^&#" MYFILE.TXT
  82.  
  83. "/-C" says to skip counting the items.  This is initially the default.
  84.  
  85. "/N" says to number the output lines.  Initially defaults to "/-N".
  86.  
  87. "/-N" says to skip numbering the output lines.  This is initially the default.
  88.  
  89. "/I" says to make it a case-insensitive search.  So a search  for  "Apple"  will
  90. find "APPLE", "apple", ApPle", etc.
  91.  
  92. "/-I" is the opposite of /I and is typically the default.  A search for  "Apple"
  93. will not find "APPLE".
  94.  
  95. "/P" says to have the display pause  every  24  lines.   Initially  defaults  to
  96. "/-P".
  97.  
  98. "/-P" says to not bother pausing the output  display.   This  is  initially  the
  99. default.
  100.  
  101. "/-HEADER" says to skip the normal -----infile output line that  appears  before
  102. the results of the output.
  103.  
  104. "/HEADER" says to include the headers.  This  is  initially  the  default.   The
  105. header lines look like this:
  106.  
  107.      --------- C:\VBDOS\BFIND.BAS
  108.  
  109. "/EMPTY" says that the -----infile header information is to be shown even if the
  110. file doesn't have any hits in it.  This is initially the default.
  111.  
  112. "/-EMPTY" says to only show the -----infile header information if the  file  has
  113. hits.  Initially defaults to "/EMPTY".
  114.  
  115.  
  116. BFIND.DOC                            3                         Revised: 07-19-96
  117.  
  118. "/FILTER" says to remove all nonprintable characters from the output.  Initially
  119. defaults to "/-FILTER".
  120.  
  121. "/-FILTER" says to not bother removing  the  nonprintable  characters  from  the
  122. output.  This is initially the default.
  123.  
  124. "/FILTER=filename" specifies that a filter is to be  applied  and  all  non-same
  125. character replacements are in the file "filename".   This  feature  is  of  very
  126. limited usefulness in the  BFIND  program  unless  you're  reading  native  word
  127. processing files.  If this excites you for some reason, get the ZIP  READymm.ZIP
  128. and read the documentation for the READY program.  The feature works identically
  129. in both programs.
  130.  
  131. "/LINES line1-line2" says to restrict the search to lines between  line  numbers
  132. line1 and line2 inclusive.  You can have multiple line  requests  in  any  order
  133. such as "/LINES 1-10 90-100 30-50".  The  routine  skips  all  lines  after  the
  134. largest line number is encountered.  Defaults to "/LINES 1-9999999".
  135.  
  136. "/LINES line1 linect" says to restrict the search to lines beginning with  line1
  137. and continuing for a total of linect lines.  So "/LINES 10 20" is  actually  the
  138. same as "/LINES 10-29".
  139.  
  140. "/MONO" (or "/-COLOR") does  not  try  to  override  screen  colors.   Initially
  141. defaults to "/COLOR".
  142.  
  143. "/COLOR" (or "/-MONO") allows screen colors to be overridden.  This is initially
  144. the default.
  145.  
  146. "/Iinitfile" says to read an initialization file with the file name  "initfile".
  147. The file specification *must* contain a period.  Initfiles are described in  the
  148. BRUCEINI.DOC file.  Initially defaults to "/IBFIND.INI".
  149.  
  150. "/INULL" says to skip loading the initialization file.
  151.  
  152. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  153.  
  154. "/?&H" gives you a hexadecimal and decimal conversion table.
  155.  
  156. "search" is described below.
  157.  
  158. "filespec" tells the routine which file or  files  are  to  be  processed.   The
  159. specification can include path and wildcards  if  desired.   One  thing  I  find
  160. useful with wildcards is that is allows me to create an output that concatenates
  161. all of the input files together with the typical headers (/HEADER) that separate
  162. each portion.  This requires searching for all lines in a file so  you  need  to
  163. use the  /V  option  and  look  for  an  improbable  string.   For  example,  to
  164. concatenate all *.TXT files together as a new file called TEMP.NEW and have  the
  165. little header between each, say this:
  166.  
  167.         BFIND /V "&#$#" *.TXT > TEMP.NEW
  168.  
  169. "@listfile" allows you to have a variety of file specifications saved in a  text
  170. file named "listfile".  Each line  in  the  file  should  consist  of  one  file
  171. specification, each of which can include a path and wildcards if desired.  Blank
  172. lines and lines beginning with semi-colons, colons, or quotes are  ignored.   An
  173. example using this is provided at the end of this documentation.
  174.  
  175.  
  176. BFIND.DOC                            4                         Revised: 07-19-96
  177.  
  178.